<?php


$block = $this->block;
$showPicture = (bool)$block->params['showPicture'];
$showTitle = (bool)$block->params['showTitle'];
$showSummary = (bool)$block->params['showSummary'];
$showCategoryLink = (bool)$block->params['showCategoryLink'];


?>
<ul>
<?php
for ($i = 0, $articlesCount = count($this->articles); $i < $articlesCount; ++$i) {
	$article = $this->articles[$i];
?>
	<li class="article <?php echo $article->mainCategorySlug , ($i == 0 ? ' first' : ''), (($i - 1)  == $articlesCount ? ' last' : '') ?>">
		<?php  if ($showPicture && '' != $article->picture) { ?><a href="<?php echo $this->escape($article->url) ?>"><img alt="<?php echo $this->escape($article->title) ?>" src="<?php echo $this->escape($article->picture) ?>"/></a><?php } ?>
		<?php  if ($showTitle) { ?><a href="<?php echo $this->escape($article->url) ?>"><?php echo $this->escape($article->title) ?></a><?php } ?>
		<?php  if ($showSummary) { ?><div class="summary"><?php echo $this->escape($article->summary) ?></div><?php } ?>
	</li>
<?php
}

if ($showCategoryLink && isset($article)) {
	echo '<p style="text-align:right"><a href="' . $article->categoryUrl . '">Más &raquo;</a></p>';
}
?>
</ul>
